import { ElNotification, ElMessage, ElMessageBox } from 'element-plus'



// 通知提示框
export function toast(message, type = "success", offset = 0, duration = 3000, dangerouslyUseHTMLString = false) {
    ElNotification({ message, type, duration, dangerouslyUseHTMLString, offset})
}

// 消息弹出框
export function toast_msg(message, type = "success",callback = "") {
    ElMessage({ message, type, onClose:callback && callback()})
}


// 查询、过滤、搜索
export function queryFilters(query) {
    let q = []
    for (const key in query) {
        if (query[key]) {
            q.push(`${key}=${encodeURIComponent(query[key])}`)
        }
    }
    let r = q.join("&")
    r = r ? ("?" + r) : ""
    return r
}
